import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";

const { createConfirm } = useMessage();



export const getLoginUser = () => defHttp.get({ url: '/crm/cProjectApplication/getLoginUser' });


/*
供应商*/
export async function getUserList() {
  const result  = await defHttp.get({ url: '/sys/user/userRoleListData' });
  return result;
}


export const ajaxGetDictItems = (code, params, options?) =>
 defHttp.get({ url: `/sys/dict/getDictItemsValue/${code}`, params }, options);


export async function getTranslate(params) {
  const result  = await defHttp.get({ url: '/crm/cCommon/translatData',params });
  return result;
}


//项目关联库详情
export async function getQueryByProjectId(params) {
  const result  = await defHttp.get({ url: '/crm/cLibrary/queryByProjectId',params });
  return result;
}

//主项目。 下拉选择
export async function getProjectList() {
  const result  = await defHttp.get({ url: '/crm/cCommon/projectList' });
  return result;
}

/**
 * 子项目 下拉选择
 * @param params
 */
export async function getSubProjectList(params) {
  const result  = await defHttp.get({ url: '/crm/cCommon/subProjectList',params });
  return result;
}

/**
 * 分包商 下拉选择
 * @param params
 */
export async function getContractorList(params) {
  const result  = await defHttp.get({ url: '/crm/cCommon/contractorList',params });
  return result;
}

/**
 * 总包商
 * @param params
 */
export async function getCompanyInfoList(params) {
  const result  = await defHttp.get({ url: '/crm/cCommon/companyInfoList',params });
  return result;
}


/**
 * 首页
 * @param params
 */
export async function getDataListData(params) {
  const result  = await defHttp.get({ url: '/crm/index/dataList',params });
  return result;
}

/**
 * 首页 子项目每个月数量
 * @param params
 */
export async function getSubProjectdataChartList(params) {
  const result  = await defHttp.get({ url: '/crm/index/dataChartList',params });
  return result;
}


/**
 * 首页 支出
 * @param params
 */
export async function getPaymentRequestChartList(params) {
  const result  = await defHttp.get({ url: '/crm/index/dataExpenditureChartList',params });
  return result;
}

/**
 * 首页 第二行 柱装图
 * @param params
 */
export async function getSubProjectBarData(params) {
  const result  = await defHttp.get({ url: '/crm/index/subProjectBarData',params });
  return result;
}
/**
 * 首页 第二行 列表排名
 * @param params
 */
export async function getSubProjectListData(params) {
  const result  = await defHttp.get({ url: '/crm/index/SubProjectList',params });
  return result;
}

export async function getLineMultiData(params) {
  const result  = await defHttp.get({ url: '/crm/index/lineMultiData',params });
  return result;
}


/**
 * 待处理
 */
export async function getPending() {
  const result  = await defHttp.get({ url: '/crm/index/pending' });
  return result;
}






